package com.jit.app.listener;

import android.view.View;
import android.view.ViewGroup;

import com.alibaba.fastjson.JSONObject;
import com.jit.app.AppMarketApplication;
import com.jit.app.R;

public class DownloadClickListener implements View.OnClickListener {

    @Override
    public void onClick(View v) {
        //点击了下载按钮，就把下载按钮隐藏，把进度条显示出来
        v.setVisibility(View.INVISIBLE);
       ((ViewGroup)(v.getParent())).findViewById(R.id.pb_download).setVisibility(View.VISIBLE);
        JSONObject jsonObject = (JSONObject) v.getTag();

        AppMarketApplication.downloadBinder.addDownloadTask(jsonObject.getString("apkName"), jsonObject.getString("downloadLink"));
    }
}
